import request from '@u/request'
import { HttpMethod } from '@u/http'


// 退出方法
export function logout () {
  return request({
    url: '/auth/logout',
    method: HttpMethod.DELETE
  })
}

// 刷新方法
export function refreshToken () {
  return request({
    url: '/auth/refresh',
    method: HttpMethod.POST
  })
}

// 获取用户详细信息
export function getInfo () {
  return request({
    url: '/sys/user/getInfo',
    method: HttpMethod.GET
  })
}


// 滑块验证码登录方法
export function loginSlide (username, password, captchaVO) {
  return request({
    url: '/auth/login/slide',
    method: HttpMethod.POST,
    data: { username, password, captchaVO }
  })
}


// 获取验证图片  以及token
export function getCaptcha (data) {
  return request({
    url: '/auth/captcha/get',
    method: HttpMethod.POST,
    data
  })
}

// 滑动或者点选验证
export function captchaCheck (data) {
  return request({
    url: '/auth/captcha/check',
    method: HttpMethod.POST,
    data
  })
}
